Product
Introducing Ruby Support in Socket
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
chromium-edge-launcher
Advanced tools
Launch Microsoft Edge with ease from node.
remote-debugging-port
on an available portkill()
Ctrl-C
(by default) to terminate the Edge process_This project started as a fork of Chrome Launcher and inherits, whereas possible, all its features.
yarn add chromium-edge-launcher
# or with npm:
npm install chromium-edge-launcher
.launch([opts])
{
// (optional) remote debugging port number to use. If provided port is already busy, launch() will reject
// Default: an available port is autoselected
port: number;
// (optional) Additional flags to pass to Edge, for example: ['--headless', '--disable-gpu']
// See: https://github.com/cezaraugusto/chromium-edge-launcher/blob/master/docs/edge-flags-for-tools.md
// Do note, many flags are set by default: https://github.com/cezaraugusto/chromium-edge-launcher/blob/master/src/flags.ts
edgeFlags: Array<string>;
// (optional) Close the Edge process on `Ctrl-C`
// Default: true
handleSIGINT: boolean;
// (optional) Explicit path of intended Edge binary
// * If this `edgePath` option is defined, it will be used.
// * Otherwise, the `EDGE_PATH` env variable will be used if set. (`LIGHTHOUSE_CHROMIUM_PATH` is deprecated)
// * Otherwise, a detected Edge Canary will be used if found
// * Otherwise, a detected Edge (stable) will be used
edgePath: string;
// (optional) Edge profile path to use, if set to `false` then the default profile will be used.
// By default, a fresh Edge profile will be created
userDataDir: string | boolean;
// (optional) Starting URL to open the browser with
// Default: `about:blank`
startingUrl: string;
// (optional) Logging level
// Default: 'silent'
logLevel: 'verbose'|'info'|'error'|'silent';
// (optional) Flags specific in [flags.ts](src/flags.ts) will not be included.
// Typically used with the defaultFlags() method and edgeFlags option.
// Default: false
ignoreDefaultFlags: boolean;
// (optional) Interval in ms, which defines how often launcher checks browser port to be ready.
// Default: 500
connectionPollInterval: number;
// (optional) A number of retries, before browser launch considered unsuccessful.
// Default: 50
maxConnectionRetries: number;
// (optional) A dict of environmental key value pairs to pass to the spawned edge process.
envVars: {[key: string]: string};
};
.launch().then(edge => ...
// The remote debugging port exposed by the launched edge
edge.port: number;
// Method to kill Edge (and cleanup the profile folder)
edge.kill: () => Promise<void>;
// The process id
edge.pid: number;
// The childProcess object for the launched Edge
edge.process: childProcess
EdgeLauncher.Launcher.defaultFlags()
Returns an Array<string>
of the default flags Edge is launched with. Typically used along with the ignoreDefaultFlags
and edgeFlags
options.
Note: This array will exclude the following flags: --remote-debugging-port
--disable-setuid-sandbox
--user-data-dir
.
EdgeLauncher.Launcher.getInstallations()
Returns an Array<string>
of paths to available Edge installations. When edgePath
is not provided to .launch()
, the first installation returned from this method is used instead.
Note: This method performs synchronous I/O operations.
.killAll()
Attempts to kill all Edge instances created with .launch([opts])
. Returns a Promise that resolves to an array of errors that occurred while killing instances. If all instances were killed successfully, the array will be empty.
const EdgeLauncher = require('chromium-edge-launcher');
async function cleanup() {
await EdgeLauncher.killAll();
}
const EdgeLauncher = require('chromium-edge-launcher');
EdgeLauncher.launch({
startingUrl: 'https://google.com'
}).then(edge => {
console.log(`Edge debugging port running on ${edge.port}`);
});
const EdgeLauncher = require('chromium-edge-launcher');
EdgeLauncher.launch({
startingUrl: 'https://google.com',
edgeFlags: ['--headless', '--disable-gpu']
}).then(edge => {
console.log(`Edge debugging port running on ${edge.port}`);
});
const EdgeLauncher = require('chromium-edge-launcher');
const newFlags = EdgeLauncher.Launcher.defaultFlags().filter(flag => flag !== '--disable-extensions' && flag !== '--mute-audio');
EdgeLauncher.launch({
ignoreDefaultFlags: true,
edgeFlags: newFlags,
}).then(edge => { ... });
In a CI environment like Travis, Edge may not be installed. If you want to use chromium-edge-launcher
, Travis can install Edge at run time with an addon. Alternatively, you can also install Edge using the download-edge.sh
script.
Then in .travis.yml
, use it like so:
language: node_js
install:
- yarn install
before_script:
- export DISPLAY=:99.0
- export CHROME_PATH="$(pwd)/edge-linux/edge"
- sh -e /etc/init.d/xvfb start
- sleep 3 # wait for xvfb to boot
addons:
edge: stable
This project started as a fork of, and is inspired by https://github.com/cezaraugusto/chromium-edge-launcher which is released under the Apache-2.0 License, and is copyright of Google Inc. Original contributors and git commit history kept as-is after the fork.
FAQs
Launch latest Edge with the Devtools Protocol port open
The npm package chromium-edge-launcher receives a total of 857,820 weekly downloads. As such, chromium-edge-launcher popularity was classified as popular.
We found that chromium-edge-launcher demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.